from django.db import models

# Create your models here.
class User(models.Model):
    username = models.CharField(max_length=50)
    password = models.CharField(max_length=50)
class CateNew(models.Model):
    name = models.CharField(max_length=50)
class News(models.Model):
    title = models.CharField(max_length=50)
    content = models.CharField(max_length=50)
    stars = models.IntegerField(default=0)
    cate = models.ForeignKey(CateNew,on_delete=models.CASCADE)

class Teacher(models.Model):
    name = models.CharField(max_length=50)
    password = models.CharField(max_length=50)
    phone = models.CharField(max_length=11)
class Student(models.Model):
    stt_name = models.CharField(max_length=50)
    stu_sex = models.CharField(max_length=2)
    stu_icon = models.ImageField(upload_to='img')
    stu_desc = models.CharField(max_length=100)
    teacher = models.ForeignKey(Teacher,on_delete=models.CASCADE,null=True)
class Stars(models.Model):
    stars = models.IntegerField(default=0)
    stul = models.ForeignKey(Student,on_delete=models.CASCADE,null=True)







